from base import Base
from selenium.webdriver.common.by import By

class page1(Base):
    # 兄弟
    def test_brother(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().resourceId("com.kongfz.app:id/ll_nav1").formParent(index(4))')
        ele=self.find_ele(loc)
        return ele
    # 父子
    def test_father(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().className("android.widget.LinearLayout").instance(73).childSelector(index(4))')
        ele=self.find_ele(loc)
        return ele
    # id
    def test_kuang(self):
        loc=(By.ID,'com.kongfz.app:id/ll_search')
        ele=self.find_ele(loc)
        return ele
    #CLASS_NAME
    def test_sousuo(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_ele(loc)
        return ele
    #ANDROID_UIAUTOMATOR
    def test_anniu(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().resourceId("com.kongfz.app:id/rlSearch")')
        ele=self.find_ele(loc)
        return ele


    # test
    def xiyouji(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("西游记（全二册）")')
        ele=self.find_ele(loc)
        return ele
    # xpath
    def shop(self):
        loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.kongfz.app:id/tvGoods"]')
        ele=self.find_ele(loc)
        return ele
